#include <iostream>
#include <vector>
#include <string>

using namespace std;

int hammingWeight(uint32_t n) {
    int i = 32, h = 0;
    while(i--)
    {
        h += n & 1;
        // 将n右移1位
        n >>= 1;
    }
    return h;
}

int main(){
    uint32_t n = 0x0000000b;
    cout << hammingWeight(n) << endl;
    return 0;
}
